Generated by Cython 3.0.2
Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.
Raw output: normalize.c
+01: # cython: infer_types=True, wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3, profile=True, autogen_pxd=True
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
02:
03: from libc.math cimport sqrt
+04: import numpy as np
__pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
05: cimport numpy as np
06:
07: from cython.parallel import prange
08:
09:
+10: def normalizeFFT(fft_real: np.ndarray, fft_imag: np.ndarray):
/* Python wrapper */
static PyObject *__pyx_pw_7nanopyx_4core_9transform_9normalize_1normalizeFFT(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7nanopyx_4core_9transform_9normalize_1normalizeFFT = {"normalizeFFT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7nanopyx_4core_9transform_9normalize_1normalizeFFT, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7nanopyx_4core_9transform_9normalize_1normalizeFFT(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyArrayObject *__pyx_v_fft_real = 0;
PyArrayObject *__pyx_v_fft_imag = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("normalizeFFT (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_MACROS
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 10, __pyx_L3_error)
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fft_real,&__pyx_n_s_fft_imag,0};
PyObject* values[2] = {0,0};
if (__pyx_kwds) {
Py_ssize_t kw_args;
switch (__pyx_nargs) {
case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
switch (__pyx_nargs) {
case 0:
if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_real)) != 0)) {
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
kw_args--;
}
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_imag)) != 0)) {
(void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
kw_args--;
}
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
else {
__Pyx_RaiseArgtupleInvalid("normalizeFFT", 1, 2, 2, 1); __PYX_ERR(0, 10, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "normalizeFFT") < 0)) __PYX_ERR(0, 10, __pyx_L3_error)
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
}
__pyx_v_fft_real = ((PyArrayObject *)values[0]);
__pyx_v_fft_imag = ((PyArrayObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("normalizeFFT", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 10, __pyx_L3_error)
goto __pyx_L3_error;
__pyx_L3_error:;
{
Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
__Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
}
}
__Pyx_AddTraceback("nanopyx.core.transform.normalize.normalizeFFT", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fft_real), __pyx_ptype_5numpy_ndarray, 0, "fft_real", 0))) __PYX_ERR(0, 10, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fft_imag), __pyx_ptype_5numpy_ndarray, 0, "fft_imag", 0))) __PYX_ERR(0, 10, __pyx_L1_error)
__pyx_r = __pyx_pf_7nanopyx_4core_9transform_9normalize_normalizeFFT(__pyx_self, __pyx_v_fft_real, __pyx_v_fft_imag);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
{
Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
__Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
}
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_7nanopyx_4core_9transform_9normalize_normalizeFFT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_fft_real, PyArrayObject *__pyx_v_fft_imag) {
PyObject *__pyx_r = NULL;
__Pyx_TraceDeclarations
__Pyx_TraceFrameInit(__pyx_codeobj__11)
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("normalizeFFT", 0);
__Pyx_TraceCall("normalizeFFT", __pyx_f[0], 10, 0, __PYX_ERR(0, 10, __pyx_L1_error));
/* … */
/* function exit code */
__pyx_L1_error:;
__PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("nanopyx.core.transform.normalize.normalizeFFT", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_TraceReturn(__pyx_r, 0);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_fft_real, __pyx_n_s_fft_imag); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__23);
__Pyx_GIVEREF(__pyx_tuple__23);
/* … */
__pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fft_real, __pyx_kp_s_np_ndarray) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fft_imag, __pyx_kp_s_np_ndarray) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7nanopyx_4core_9transform_9normalize_1normalizeFFT, 0, __pyx_n_s_normalizeFFT, NULL, __pyx_n_s_nanopyx_core_transform_normalize, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalizeFFT, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+11: return _normalizeFFT(fft_real, fft_imag)
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(((PyObject *)__pyx_v_fft_real), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 11, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(((PyObject *)__pyx_v_fft_imag), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 11, __pyx_L1_error) __pyx_t_3 = __pyx_f_7nanopyx_4core_9transform_9normalize__normalizeFFT(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 11, __pyx_L1_error) __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1); __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1); __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL; __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_3, 3, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0;
12:
+13: cdef float[:, :, :] _normalizeFFT(float[:, :] fft_real, float[:, :] fft_imag) nogil:
static __Pyx_memviewslice __pyx_f_7nanopyx_4core_9transform_9normalize__normalizeFFT(__Pyx_memviewslice __pyx_v_fft_real, __Pyx_memviewslice __pyx_v_fft_imag) {
double __pyx_v_mag;
int __pyx_v_x_i;
int __pyx_v_y_i;
__Pyx_memviewslice __pyx_v_output = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_TraceDeclarations
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_normalizeFFT", 1);
__Pyx_TraceCall("_normalizeFFT", __pyx_f[0], 13, 1, __PYX_ERR(0, 13, __pyx_L1_error));
/* … */
/* function exit code */
__pyx_L1_error:;
#ifdef WITH_THREAD
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
__pyx_r.data = NULL;
__pyx_r.memview = NULL;
__Pyx_AddTraceback("nanopyx.core.transform.normalize._normalizeFFT", __pyx_clineno, __pyx_lineno, __pyx_filename);
goto __pyx_L2;
__pyx_L0:;
if (unlikely(!__pyx_r.memview)) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
__pyx_L2:;
#ifdef WITH_THREAD
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__PYX_XCLEAR_MEMVIEW(&__pyx_v_output, 1);
__Pyx_TraceReturn(Py_None, 0);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
14:
15: cdef double mag
16: cdef int x_i, y_i
17: cdef float[:, :, :] output
+18: with gil:
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
/*try:*/ {
/* … */
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
goto __pyx_L5;
}
__pyx_L4_error: {
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
goto __pyx_L1_error;
}
__pyx_L5:;
}
}
+19: output = np.zeros((2, fft_real.shape[0], fft_real.shape[1]), dtype=np.float32)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_fft_real.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_fft_real.shape[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_2)) __PYX_ERR(0, 19, __pyx_L4_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 19, __pyx_L4_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 19, __pyx_L4_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 19, __pyx_L4_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 19, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_output = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; }
20:
+21: for x_i in prange(fft_real.shape[1]):
{
#ifdef WITH_THREAD
PyThreadState *_save;
_save = NULL;
if (PyGILState_Check()) {
Py_UNBLOCK_THREADS
}
__Pyx_FastGIL_Remember();
#endif
/*try:*/ {
if (unlikely(!__pyx_v_fft_real.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("fft_real"); __PYX_ERR(0, 21, __pyx_L7_error) }
__pyx_t_7 = (__pyx_v_fft_real.shape[1]);
{
#if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
#undef likely
#undef unlikely
#define likely(x) (x)
#define unlikely(x) (x)
#endif
__pyx_t_9 = (__pyx_t_7 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_9 > 0)
{
#ifdef _OPENMP
#pragma omp parallel
#endif /* _OPENMP */
{
#ifdef _OPENMP
#pragma omp for lastprivate(__pyx_v_mag) firstprivate(__pyx_v_x_i) lastprivate(__pyx_v_x_i) lastprivate(__pyx_v_y_i)
#endif /* _OPENMP */
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_9; __pyx_t_8++){
{
__pyx_v_x_i = (int)(0 + 1 * __pyx_t_8);
/* Initialize private variables to invalid values */
__pyx_v_mag = ((double)__PYX_NAN());
__pyx_v_y_i = ((int)0xbad0bad0);
/* … */
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
__Pyx_FastGIL_Forget();
if (_save) {
Py_BLOCK_THREADS
}
#endif
goto __pyx_L8;
}
__pyx_L7_error: {
#ifdef WITH_THREAD
__Pyx_FastGIL_Forget();
if (_save) {
Py_BLOCK_THREADS
}
#endif
goto __pyx_L1_error;
}
__pyx_L8:;
}
}
+22: for y_i in range(fft_real.shape[0]):
__pyx_t_10 = (__pyx_v_fft_real.shape[0]);
__pyx_t_11 = __pyx_t_10;
for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
__pyx_v_y_i = __pyx_t_12;
+23: mag = sqrt(fft_real[y_i, x_i]**2 + fft_imag[y_i, x_i]**2)
__pyx_t_13 = __pyx_v_y_i;
__pyx_t_14 = __pyx_v_x_i;
__pyx_t_15 = __pyx_v_y_i;
__pyx_t_16 = __pyx_v_x_i;
__pyx_v_mag = sqrt((powf((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_fft_real.data + __pyx_t_13 * __pyx_v_fft_real.strides[0]) ) + __pyx_t_14 * __pyx_v_fft_real.strides[1]) ))), 2.0) + powf((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_fft_imag.data + __pyx_t_15 * __pyx_v_fft_imag.strides[0]) ) + __pyx_t_16 * __pyx_v_fft_imag.strides[1]) ))), 2.0)));
24:
+25: if mag != 0:
__pyx_t_17 = (__pyx_v_mag != 0.0);
if (__pyx_t_17) {
/* … */
}
}
}
}
}
}
}
#if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
#undef likely
#undef unlikely
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
}
+26: output[0][y_i, x_i] = fft_real[y_i, x_i] / mag
__pyx_t_16 = __pyx_v_y_i;
__pyx_t_15 = __pyx_v_x_i;
__pyx_t_14 = 0;
__pyx_t_13 = __pyx_v_y_i;
__pyx_t_18 = __pyx_v_x_i;
*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_output.data + __pyx_t_14 * __pyx_v_output.strides[0]) ) + __pyx_t_13 * __pyx_v_output.strides[1]) ) + __pyx_t_18 * __pyx_v_output.strides[2]) )) = (((double)(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_fft_real.data + __pyx_t_16 * __pyx_v_fft_real.strides[0]) ) + __pyx_t_15 * __pyx_v_fft_real.strides[1]) )))) / __pyx_v_mag);
+27: output[1][y_i, x_i] = fft_imag[y_i, x_i] / mag
__pyx_t_15 = __pyx_v_y_i;
__pyx_t_16 = __pyx_v_x_i;
__pyx_t_18 = 1;
__pyx_t_13 = __pyx_v_y_i;
__pyx_t_14 = __pyx_v_x_i;
*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_output.data + __pyx_t_18 * __pyx_v_output.strides[0]) ) + __pyx_t_13 * __pyx_v_output.strides[1]) ) + __pyx_t_14 * __pyx_v_output.strides[2]) )) = (((double)(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_fft_imag.data + __pyx_t_15 * __pyx_v_fft_imag.strides[0]) ) + __pyx_t_16 * __pyx_v_fft_imag.strides[1]) )))) / __pyx_v_mag);
28:
+29: return output
__PYX_INC_MEMVIEW(&__pyx_v_output, 0); __pyx_r = __pyx_v_output; goto __pyx_L0;